<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <span>{{ msg }}</span>

      <!-- 如果开始标签和结束标签之间没有填写任何内容，那么就会使用组件插槽默认内容 -->
      <!-- 如果填了，那么以填的为准 -->
      <submit-button>保存</submit-button>
    </div>

    <script src="./js/vue.js"></script>
    <script>
      Vue.component('SubmitButton', {
        template: `
          <div>
            <button>
              <slot>提交</slot>
            </button>
          </div>
        `,
      });

      new Vue({
        el: '#app',
        data: {
          msg: 'hehe',
        },
      });
    </script>
  </body>
</html>
